# 
# Created with PyCharm.
# Description :
# User: jiume
# Date: 2024-12-14
# Time: 20:58
#
year, month = map(int, input("请输入“年份，月份”（格式如：2020,4）：").split(","))
if month in [1, 3, 5, 7, 8, 10, 12]:
    print(31)
elif month in [4, 6, 9, 11]:
    print(30)
elif month == 2:
    if (year % 4 == 0 and year % 100!= 0) or year % 400 == 0:
        print(29)
    else:
        print(28)